#include "WinPeripheralDevEvent.h"
#include "logo_dat.h" 
#include "ctrlconvert.h"

unsigned char PerpheralDevRemoved = 0;
extern unsigned char PC_Connect;
//extern unsigned char osdsettpval(unsigned char num,unsigned char level);

INT32S WinConPeripheralDevOnShow(PHWND hwnd, INT32S lpParam)
{
	ReloadLogo(Logo_keyboard, sizeof(Logo_keyboard)); 
	if(PC_Connect)
	{
		hwnd->draw_info[1].draw_data = (INT32U) PC_CONNECT_STR;
	}
	return 0 ;
}
INT32S WinConPeripheralDevOnKeyPress(PHWND hwnd, INT32S lpParam)
{
	INT32U *key_value = (INT32U *)lpParam ;
	switch(*key_value)
	{
		default:
			break;
	}
	return 0 ;
}
INT32S WinConPeripheralDevOnOtherEvent(PHWND hwnd, INT32U msg_type, INT32S lpParam)
{
	static unsigned char i = 0;
	switch(msg_type)
	{
        	case WM_SECOND_TIMEOUT:
			if ((PerpheralDevRemoved == 1) && (++i>1))
			{
				i = 0;
				PerpheralDevRemoved = 0;
				GUIShowWindow(WinDeviceSelect);
				ReloadLogo(Logo_keyboard, sizeof(Logo_keyboard));  
                		//remount after disconnect
				FileNavReMount("/mnt/C");
			}
			break;
		default:
			break;
	}
	return 0 ;
}
INT32S WinPeripheralDevOnShow(PHWND hwnd, INT32S lpParam)
{
	osdsettpval(0,0xf);
	return 0 ;
}
INT32S WinConPeripheralDevOnPaint(PHWND hwnd, INT32S lpParam)
{
	return 0;
}
